import { IPSAppDEView } from '../../app/view/ipsapp-deview';
import { IPSDEPickupViewPanel } from './ipsdepickup-view-panel';
import { PSDEViewPanelImpl } from './psdeview-panel-impl';

export class PSDEPickupViewPanelImpl extends PSDEViewPanelImpl implements IPSDEPickupViewPanel {
  protected embeddedpsappdeview: IPSAppDEView | null = null;

  getEmbeddedPSAppDEView(): IPSAppDEView | null {
    if (this.embeddedpsappdeview != null) return this.embeddedpsappdeview;
    const value = this.M.getEmbeddedPSAppDEView;
    if (value == null) {
      return null;
    }
    this.embeddedpsappdeview = this.getPSModel4('app.view.IPSAppDEView', value, 'getEmbeddedPSAppDEView') as IPSAppDEView;
    return this.embeddedpsappdeview;
  }

  get embeddedPSAppDEView(): IPSAppDEView | null {
    return this.getEmbeddedPSAppDEView();
  }

  getEmbeddedPSAppDEViewMust(): IPSAppDEView {
    const value = this.getEmbeddedPSAppDEView();
    if (value == null) {
      throw new Error('未指定嵌入视图对象');
    }
    return value;
  }

  get cls(): string {
    return 'PSDEPickupViewPanelImpl';
  }

  instanceof(cls: string): boolean {
    if (cls == 'control.viewpanel.IPSDEPickupViewPanel') return true;
    return super.instanceof(cls);
  }
}
